<?php

	$this->Html->script(array('flexigrid.pack','jquery.maskedinput-1.2.2.min','maskinput','somente-numeros'), false);
	$this->Html->css('flexigrid', null, array('inline' => false));
	
	$calendarioacademico_id = $this->request->data['CalendarioAcademico']['id'];
	
	echo $this->Form->create('CalendarioAcademico');
	echo $this->Form->input('id');
	echo $this->Form->input('nome',array('type' => 'text', 'class' => 'tamanho50', 'label' => __('Nome'), 'maxlength' => 100));
	echo '<div style="clear:both"></div>';
	
?>

<div id="tabs">

	<ul>
		<li><a href="#tabs-Dados">Dados</a></li>
		<li><a href="#tabs-Modulos">Módulos</a></li>
		<li><a href="#tabs-CargaHoraria">Carga horária</a></li>
	</ul>
	
	<div id="tabs-Dados" class="painel_tabs">	

		<?php
			echo $this->Form->input('ano', array('type' => 'text', 'label' => __('Ano'), 'class' => 'tamanho10', 'maxlength' => 4, 'onKeyPress' => 'return SomenteNumero(event)'));
			echo '<div style="clear:both;"></div>';
			echo $this->Form->input('tipo_serie_id',array('type' => 'select', 'options' => $series, 'empty' => 'Selecione...', 'class' => 'tamanho50', 'label' => __('Série')));	
			echo '<div style="clear:both;"></div>';
			echo $this->Form->input('media_recup', array('type' => 'text', 'label' => __('Média Recuperação'), 'class' => 'tamanho10', 'maxlength' => 3, 'onKeyPress' => 'return SomenteNumero(event)'));
			echo $this->Form->input('media_aprovacao', array('type' => 'text', 'label' => __('Média Aprovação'), 'class' => 'tamanho10', 'maxlength' => 3, 'onKeyPress' => 'return SomenteNumero(event)'));			
			echo $this->Form->input('num_dias_letivo', array('type' => 'text', 'label' => __('Nº Dias Letivos'), 'class' => 'tamanho10', 'maxlength' => 3, 'onKeyPress' => 'return SomenteNumero(event)'));
			echo $this->Form->input('carga_horaria_total',array('type'=> 'text', 'class' => 'maskhoraria horaria', 'label' => __('Carga Horária Total')));
		?>
		
	</div>
	
	<div id="tabs-Modulos" class="painel_tabs">	

		<?php include_once 'grid_modulos.ctp'; ?>			
		
	</div>
	
	<div id="tabs-CargaHoraria" class="painel_tabs">	

		<?php include_once 'grid_carga_horaria.ctp'; ?>
		
	</div>	
	
</div>

<?php
	echo '<div class="botoes_form">';
	echo $this->Form->button('Salvar', array('type' => 'submit'));
	echo $this->Form->button('Voltar', array('type'=>'button', 'onClick' => "javascript:location='{$this->request->base}/{$this->request->controller}/index'"));
	echo '</div>'; 
	echo $this->Form->end();
?>

<script>

	$( "#tabs" ).tabs({cookie: {expires: 1}	});

</script>	